package a.d;

import a.c.q;

import java.util.ArrayList;
import java.util.Iterator;

public class r
  implements Comparable
{
  public final w a;
  public final double b;
  public static int c;
  
  public r(double paramDouble)
  {
    this.a = w.c;
    this.b = paramDouble;
  }
  
  public r(w paramw1, w paramw2, double paramDouble)
  {
    z localz1 = new z(paramw2, paramw1);
    localz1.b(0.5D);
    w localw = z.a(paramw1, localz1);
    z localz2 = z.c(localz1);
    double d1 = localz1.d();
    double d2 = Math.sqrt(paramDouble * paramDouble - d1 * d1);
    localz2.b(d2);
    this.a = z.a(localw, localz2);
    this.b = paramDouble;
  }
  
  public r(w paramw1, w paramw2, w paramw3)
  {
    double d1 = paramw1.a();
    double d2 = paramw1.b();
    double d3 = paramw2.a();
    double d4 = paramw2.b();
    double d5 = paramw3.a();
    double d6 = paramw3.b();
    double d7 = (d1 * d1 + d2 * d2) * (d4 - d6) + (d3 * d3 + d4 * d4) * (d6 - d2) + (d5 * d5 + d6 * d6) * (d2 - d4);
    double d8 = -(d1 * d1 + d2 * d2) * (d3 - d5) - (d3 * d3 + d4 * d4) * (d5 - d1) - (d5 * d5 + d6 * d6) * (d1 - d3);
    double d9 = 2.0D * ((d3 - d1) * (d6 - d2) - (d5 - d1) * (d4 - d2));
    if (!bool2)
    {
      if (d9 == 0.0D) {
        throw new IllegalArgumentException("Points are collinear");
      }
      this.a = new w(d7 / d9, d8 / d9);
      this.b = w.a(this.a, paramw1);
    }
    if ((bool2) || (bool1))
    {
      if (!bool2) {}
      q.n = !q.n;
    }
    if (bool2) {
      q.o = !q.o;
    }
  }
  
  public r(w paramw, double paramDouble)
  {
    this.a = paramw;
    this.b = paramDouble;
  }
  
  public w a()
  {
    return this.a;
  }
  
  public final double b()
  {
    return this.b;
  }
  
  public w[] a(double paramDouble)
  {
    boolean bool = w.e;
    double d1 = -2.0D * this.a.a();
    double d2 = this.a.a() * this.a.a() + paramDouble * paramDouble - 2.0D * this.a.b() * paramDouble + this.a.b() * this.a.b() - this.b * this.b;
    double d3 = d1 * d1 / 4.0D - d2;
    if (!bool) {
      if (d3 < 0.0D) {
        return null;
      }
    }
    if (!bool) {
      if (d3 == 0.0D)
      {
        arrayOfw = new w[1];
        if (bool) {
          break label208;
        }
        arrayOfw[0] = new w(-d1 / 2.0D, paramDouble);
        if (!w.d) {
          return arrayOfw;
        }
      }
    }
    w[] arrayOfw = new w[2];
    d3 = Math.sqrt(d3);
    arrayOfw[0] = new w(-d1 / 2.0D - d3, paramDouble);
    arrayOfw[1] = new w(-d1 / 2.0D + d3, paramDouble);
    label208:
    return arrayOfw;
  }
  
  public w[] b(double paramDouble)
  {
    boolean bool = w.e;
    double d1 = -2.0D * this.a.b();
    double d2 = this.a.b() * this.a.b() + paramDouble * paramDouble - 2.0D * this.a.a() * paramDouble + this.a.a() * this.a.a() - this.b * this.b;
    double d3 = d1 * d1 / 4.0D - d2;
    if (!bool) {
      if (d3 < 0.0D) {
        return null;
      }
    }
    if (!bool) {
      if (d3 == 0.0D)
      {
        arrayOfw = new w[1];
        if (bool) {
          break label208;
        }
        arrayOfw[0] = new w(paramDouble, -d1 / 2.0D);
        if (!w.d) {
          return arrayOfw;
        }
      }
    }
    w[] arrayOfw = new w[2];
    d3 = Math.sqrt(d3);
    arrayOfw[0] = new w(paramDouble, -d1 / 2.0D - d3);
    arrayOfw[1] = new w(paramDouble, -d1 / 2.0D + d3);
    label208:
    return arrayOfw;
  }
  
  public w[] a(c paramc)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    double d1 = paramc.a();
    double d2 = paramc.b();
    double d3 = paramc.c();
    double d4 = this.a.a();
    double d5 = this.a.b();
    if (!bool2) {
      if (paramc.a() == 0.0D)
      {
        d7 = -d3 / d2;
        d8 = -2.0D * d4;
        d9 = (d3 / d2 + d5) * (d3 / d2 + d5) - this.b * this.b + d4 * d4;
        d10 = d8 * d8 / 4.0D - d9;
        if (!bool2) {
          if (d10 < 0.0D) {
            return null;
          }
        }
        if (!bool2) {
          if (d10 == 0.0D)
          {
            arrayOfw = new w[1];
            d6 = -d8 / 2.0D;
            if (bool2) {
              break label253;
            }
            arrayOfw[0] = new w(d6, d7);
            if (!bool1) {
              break label252;
            }
          }
        }
        arrayOfw = new w[2];
        d10 = Math.sqrt(d10);
        d6 = -d8 / 2.0D - d10;
        arrayOfw[0] = new w(d6, d7);
        d6 = -d8 / 2.0D + d10;
        arrayOfw[1] = new w(d6, d7);
        label252:
        label253:
        return arrayOfw;
      }
    }
    double d6 = ((2.0D * d2 * d3 + 2.0D * d2 * d1 * d4) / (d1 * d1) - 2.0D * d5) / (1.0D + d2 * d2 / (d1 * d1));
    double d7 = (d3 * d3 / (d1 * d1) + 2.0D * d3 * d4 / d1 + d4 * d4 + d5 * d5 - this.b * this.b) / (1.0D + d2 * d2 / (d1 * d1));
    double d8 = d6 * d6 / 4.0D - d7;
    if (!bool2) {
      if (d8 < 0.0D) {
        return null;
      }
    }
    if (!bool2) {
      if (d8 == 0.0D)
      {
        arrayOfw = new w[1];
        d10 = -d6 / 2.0D;
        d9 = (-d2 * d10 - d3) / d1;
        if (bool2) {
          break label539;
        }
        arrayOfw[0] = new w(d9, d10);
        if (!bool1) {
          return arrayOfw;
        }
      }
    }
    w[] arrayOfw = new w[2];
    d8 = Math.sqrt(d8);
    double d10 = -d6 / 2.0D - d8;
    double d9 = (-d2 * d10 - d3) / d1;
    arrayOfw[0] = new w(d9, d10);
    d10 = -d6 / 2.0D + d8;
    d9 = (-d2 * d10 - d3) / d1;
    arrayOfw[1] = new w(d9, d10);
    label539:
    return arrayOfw;
  }
  
  public w[] a(w paramw, s params)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    w[] arrayOfw1 = null;
    ArrayList localArrayList1 = new ArrayList(2);
    ArrayList localArrayList2 = new ArrayList(4);
    w[] arrayOfw2 = a(paramw.b());
    if (!bool2) {
      if (arrayOfw2 != null)
      {
        int i = 0;
        do
        {
          if (i >= arrayOfw2.length) {
            break;
          }
          localArrayList2.add(arrayOfw2[i]);
          i++;
        } while (!bool1);
      }
    }
    w[] arrayOfw3 = a(paramw.b() + params.c());
    if (arrayOfw3 != null)
    {
      int j = 0;
      do
      {
        if (j >= arrayOfw3.length) {
          break;
        }
        if (bool1) {
          break label139;
        }
        localArrayList2.add(arrayOfw3[j]);
        j++;
      } while (!bool1);
    }
    label139:
    Object localObject1 = localArrayList2.iterator();
    do
    {
      do
      {
        do
        {
          if (!((Iterator)localObject1).hasNext()) {
            break;
          }
          localObject2 = (w)((Iterator)localObject1).next();
        } while (((w)localObject2).a() < paramw.a());
        if (bool2) {
          break;
        }
      } while (((w)localObject2).a() > paramw.a() + params.b());
      if (bool2) {
        break label228;
      }
      localArrayList1.add(localObject2);
    } while (!bool1);
    label228:
    localObject1 = new ArrayList(4);
    Object localObject2 = b(paramw.a());
    if (!bool2) {
      if (localObject2 != null)
      {
        int k = 0;
        do
        {
          if (k >= localObject2.length) {
            break;
          }
          ((ArrayList)localObject1).add(localObject2[k]);
          k++;
        } while (!bool1);
      }
    }
    w[] arrayOfw4 = b(paramw.a() + params.b());
    if (arrayOfw4 != null)
    {
      int m = 0;
      do
      {
        if (m >= arrayOfw4.length) {
          break;
        }
        if (bool1) {
          break label337;
        }
        ((ArrayList)localObject1).add(arrayOfw4[m]);
        m++;
      } while (!bool1);
    }
    label337:
    Object localObject3 = ((ArrayList)localObject1).iterator();
    w localw;
    do
    {
      do
      {
        do
        {
          if (!((Iterator)localObject3).hasNext()) {
            break;
          }
          localw = (w)((Iterator)localObject3).next();
        } while (localw.b() < paramw.b());
        if ((bool2) || (bool1)) {
          break label428;
        }
      } while (localw.b() > paramw.b() + params.c());
      if (bool2) {
        break label425;
      }
      localArrayList1.add(localw);
    } while (!bool1);
    label425:
    if (localArrayList1.size() == 0) {
      label428:
      return null;
    }
    arrayOfw1 = new w[((ArrayList)localObject1).size()];
    if (!bool2) {
      if (localArrayList1.size() == 2)
      {
        localObject3 = (w)((ArrayList)localObject1).get(0);
        localw = (w)((ArrayList)localObject1).get(1);
        z localz1 = new z(1.0D, 0.0D);
        z localz2 = new z(paramw.a() + params.b() / 2.0D, paramw.b() + params.c() / 2.0D);
        z localz3 = new z(((w)localObject3).a(), ((w)localObject3).b());
        z localz4 = new z(localw.a(), localw.b());
        double d1 = z.d(localz1, localz2);
        double d2 = z.d(localz1, localz3);
        double d3 = z.d(localz1, localz4);
        if (!bool2) {
          if (d.a(d2, -d1) < d.a(d3, -d1))
          {
            arrayOfw1[0] = localObject3;
            arrayOfw1[1] = localw;
            if (!bool2) {
              if (!bool1) {
                return arrayOfw1;
              }
            }
          }
          else
          {
            arrayOfw1[0] = localw;
            arrayOfw1[1] = localObject3;
          }
        }
        return arrayOfw1;
      }
    }
    int n = 0;
    do
    {
      if (n >= localArrayList1.size()) {
        break;
      }
      if ((!bool2) && (bool1)) {
        break label693;
      }
      arrayOfw1[n] = ((w)localArrayList1.get(n));
      n++;
    } while (!bool1);
    label693:
    return arrayOfw1;
  }
  
  public boolean equals(Object paramObject)
  {
    boolean bool = w.e;
    if (!bool) {
      if (this == paramObject) {
        return true;
      }
    }
    if (!bool) {
      if (!(paramObject instanceof r)) {
        return false;
      }
    }
    r localr = (r)paramObject;
    if ((bool) || (localr.b == this.b)) {
      if (bool) {}
    }
    return localr.a.equals(this.a);
  }
  
  public int hashCode()
  {
    return this.a.hashCode() ^ (int)Double.doubleToLongBits(this.b);
  }
  
  public int compareTo(Object paramObject)
  {
    boolean bool = w.e;
    r localr = (r)paramObject;
    if (!bool) {
      if (this.a.a < localr.a.a) {
        return -1;
      }
    }
    if (!bool) {
      if (this.a.a > localr.a.a) {
        return 1;
      }
    }
    if (!bool) {
      if (this.a.b < localr.a.b) {
        return -1;
      }
    }
    if (!bool) {
      if (this.a.b > localr.a.b) {
        return 1;
      }
    }
    if (!bool) {
      if (this.b > localr.b) {
        return 1;
      }
    }
    if (!bool) {
      if (this.b < localr.b) {
        return -1;
      }
    }
    return 0;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.d.r

 * JD-Core Version:    0.7.0.1

 */